<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $title?></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/struct_info.css" />
<link rel="stylesheet" href="${staticServer}/css/office_add.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/htmlfilter.js"></script>
<script src="${staticServer}/inc/js/city.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/js/web/office_add.js?1.1"></script>
<script>
var contextPath='${contextPath}';

$(function(){
	$("#province").val("<#if office??>${office.province}</#if>");
	$("#city").html("<#if office??><option>${office.city}</option></#if>");
});

function query_num(username){
	$.post( "${contextPath}/index/query_num.json",{
	 "username":username
	 }, function( d ){
		var unum = d.num;
		if(unum!=0){
			document.getElementById("unum").value = unum;
		}else{
			document.getElementById("unum").value = 0;
		}
	}, "json" );
}

</script>
</head>

<body>
<input type="hidden" id="keyname" value="<#if office??>${office.keyname}</#if>" >
	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v1.1 beta</li>
			<li>&gt;</li>
			<li>办公</li>
			<li>&gt;</li>
			<li class="current">中心地址管理</li>
		</ul>
	</div>
	<div id="caption">
		<ul>
			<li><span class="title">操作提示：</span></li>
			<li>Ctrl+Enter 提交</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table id="infotable">
			<tr>
				<th>中心名称</th>
				<td><input type="text" id="name" value="<#if office??>${office.name}</#if>" size="50" placeholder="如：杭州学院路中心" /></td>
			</tr>
			<tr rel="hide">
				<th>所在地</th>
				<td>
				<select id="province"></select> <em class="caption">（省份）</em> 
				<select id="city"></select> <em class="caption">（城市）</em></td>
			</tr>
			<tr>
				<th>本地有中心城市</th>
				<td><input type="text" id="citys" size="80" value="<#if office??>${office.citys}</#if>" placeholder="客户地址若在此列将算作 '当地有中心' 客户" />
				<p class="line"></p>
				<p class="caption">请务必参照“所在地”中的城市列表来进行填写，此处城市列表必须是当前所选省份下城市名称；多个用逗号“,”分隔。</p>
				</td>
			</tr>
			<tr>
				<th>具体地址</th>
				<td><input type="text" id="address" size="80" value="<#if office??>${office.address}</#if>" placeholder="如：浙江省杭州市西湖区学院路131-3号" /></td>
			</tr>
			<tr>
			<th>测评数量设置</th>
			<td>
			<select name="target" id="target" onchange="query_num(this.value);">
                	<option value="">-- 请选择目标 --</option>
                	<#if uList??>
						<#list uList as list>
                			<option value="${list.username}">${list.nickname}（${list.regions}-${list.departments}-${list.job}）</option>
                		</#list>
                	</#if>
                </select>
                <input type="text" id="unum" size="30" value="<#if office??>${office.unum}</#if>" placeholder="可同时测试数量" />
                
			</td>
			</tr>
				<th>手机号码</th>
				<td><input type="text" id="inphone" size="30" value="<#if office??>${office.inphone}</#if>" placeholder="公司内部沟通所用的号码" /><b>多个号码之间用冒号隔开</b></td>
			</tr>
			<tr>
				<th>座机号码</th>
				<td><input type="text" id="outphone" size="30" value="<#if office??>${office.outphone}</#if>" placeholder="对外宣传所用的号码" /><b>多个号码之间用冒号隔开</b></td>
			</tr>
			<tr>
				<th>休息日</th>
				<td id="restday">
				
					<span class="rect hand <#if office??><#if office.week1=="1">selected</#if></#if>" rel="1" style="margin-right:2px;">星期一</span>
					<span class="rect hand <#if office??><#if office.week2=="2">selected</#if></#if>" rel="2" style="margin-right:2px;">星期二</span>
					<span class="rect hand <#if office??><#if office.week3=="3">selected</#if></#if>" rel="3" style="margin-right:2px;">星期三</span>
					<span class="rect hand <#if office??><#if office.week4=="4">selected</#if></#if>" rel="4" style="margin-right:2px;">星期四</span>
					<span class="rect hand <#if office??><#if office.week5=="5">selected</#if></#if>" rel="5" style="margin-right:2px;">星期五</span>
					<span class="rect hand <#if office??><#if office.week6=="6">selected</#if></#if>" rel="6" style="margin-right:2px;">星期六</span>
					<span class="rect hand <#if office??><#if office.week7=="7">selected</#if></#if>" rel="7" style="margin-right:2px;">星期日</span>
				</td>
			</tr>
			<tr>
				<th>中心通知（预约）
					<p class="caption">通知内容将显示在预约表中</p>
				</th>
				<td><div id="notice" contenteditable="true"><#if office??>${office.notice}</#if></div>
					<p class="line"></p>
					<p>
						<input type="checkbox" id="synch"><label for="synch">同步发布通知到所有中心</label><em class="caption">（这将覆盖所有中心原有的通知内容，请谨慎操作）</em>
					</p></td>
			</tr>
		</table>
		<div id="controlbar">
			<input id="btnSubmit" type="button" class="submit" value="  保存信息  " />
		</div>
	</div>
</body>
</html>